﻿using System;
using System.Collections.Generic;
using Microsoft.SharePoint;

namespace Eneta.Portal.Common.Dto
{
    /// <summary>
    /// Base class for news items - announcements and blog entries.
    /// </summary>
    public abstract class NewsItemDto : BaseDto 
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NewsItemDto"/> class.
        /// </summary>
        protected NewsItemDto()
        {
            Comments = new List<CommentDto>();
            Keywords = new List<KeywordDto>();
        }

        /// <summary>
        /// Gets or sets the body of news item.
        /// </summary>
        public virtual string Body { get; set; }

        /// <summary>
        /// Gets or sets the comments of news item.
        /// </summary>
        public List<CommentDto> Comments { get; internal set;}

        public string FileName { get; set; }

        /// <summary>
        /// Gets or sets the display URL of news item. Display URL is item's page in portal.
        /// </summary>
        public virtual string DisplayUrl { get; internal set; }

        /// <summary>
        /// Gets or sets the name of the info source. Info source is blog for blog entries.
        /// </summary>
        public virtual string InfoSourceName { get; internal set; }

        /// <summary>
        /// Gets or sets the info source URL. Info source URL is URL to info source detail info 
        /// in portal. For blog entries it is URL to blog details page in portal.
        /// </summary>
        public virtual string InfoSourceUrl { get; internal set; }

        /// <summary>
        /// Gets or sets the keywords that are related to this news item.
        /// </summary>
        public List<KeywordDto> Keywords { get; internal set; }

        /// <summary>
        /// Gets or sets the owner profile id.
        /// </summary>
        public virtual int OwnerProfileId { get; internal set; }

        /// <summary>
        /// Gets or sets the user name of the news item owner.
        /// </summary>
        public virtual string OwnerUserName { get; internal set; }

        public virtual string OwnerProfileName { get; set;  }

        /// <summary>
        /// Gets or sets the moderation status of news item.
        /// </summary>
        public virtual SPModerationStatusType Status { get; set; }

        public virtual DateTime PublishDate { get; set; }
    }
}